﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Text;
using ExtAspNet;

namespace HY.WEB.SA
{
    public partial class _pubtel_view_e : PageBase
    {
        public string whe = "", stype = "";
        public string us ,bh,tab="pub_tel";
        protected void Page_Load(object sender, EventArgs e)
        {  
            us=Session["ID"].ToString();
            if (!IsPostBack)
            {
                if (!string.IsNullOrEmpty(Request["bh"]))
                {
                    bh = Request["bh"].ToString();
                    hidbh.Text = bh;
                    fill(bh);
                }
            }
        }

        private void fill(string bh)
        {
                 
          DataTable dt=  BLL.Bllbase.get_table("pub_tel","bh='"+bh+"'");
          Grid1.DataSource = dt;
          Grid1.DataBind();

        }

        protected void Window1_Close(object sender, EventArgs e)
        {
            //Alert.Show("修改完成 ");
            PageContext.RegisterStartupScript(ActiveWindow.GetHideReference());
        }

        protected void btnDelete_Click(object sender, EventArgs e)
        {
            int val = Grid1.PageIndex * Grid1.PageSize;
            StringBuilder sb = new StringBuilder();
            foreach (int row in Grid1.SelectedRowIndexArray)
            {
                sb.Append(Grid1.DataKeys[row + val][0].ToString());
                sb.Append(",");
            }

            Alert.ShowInTop("你选择了删除项：" + sb.ToString().TrimEnd(','));
            HY.BLL.Bllbase.DeleteList(tab, sb.ToString().TrimEnd(','));
            fill(hidbh.Text);
        }


    }
}
